package com.springclouddemo.consumer.controller;

import com.springclouddemo.consumer.service.ConsumerService;
import com.springclouddemo.demoapi.domain.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

@RestController
public class ConsumerController {
    @Autowired
    private ConsumerService service;


    public boolean save(Test test){
        return service.save(test);
    }

    @GetMapping("list")
    public Collection<Test> findAll(){
        return service.findall();
    }
}
